<template>
  <!-- 特征提取 -->
  <a-card :bordered="false">
    <!-- 查询区域 -->
    <div class="table-page-search-wrapper">
      <a-form layout="inline" @keyup.enter.native="searchQuery">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="数据集名称">
              <a-input placeholder="请输入名称" v-model="queryParam.name"></a-input>
            </a-form-item>
          </a-col>
          <a-col :xl="4" :lg="7" :md="8" :sm="24">
            <span style="float: left; overflow: hidden" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置 </a-button>
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <!-- 查询区域-END -->
    <!-- table区域-begin -->
    <div>
      <a-table
        ref="table"
        size="middle"
        bordered
        rowKey="id"
        class="j-table-force-nowrap"
        :scroll="{ x: true }"
        :columns="columns"
        :dataSource="dataSource"
        :pagination="ipagination"
        :loading="loading"
        @change="handleTableChange"
      >
        <span slot="action" slot-scope="text, record">
           <!-- <a-popconfirm title="确定删除吗?" @confirm="() => handleDelete(record.id)">
                  <a>删除</a>
                </a-popconfirm> -->
          <a @click="handleSjgy(record)">数据概要</a>
          <a-divider type="vertical" />
          <a @click="handleEdit(record)">特征值分析</a>
          <a-divider type="vertical" />
          <a @click="handleZlfx(record)">质量分析</a>
          <a-divider type="vertical" />
          <a @click="handleSjqx(record)">数据清洗</a>
        </span>
      </a-table>
    </div>
    <extract-modal ref="modalForm" @ok="modalFormOk"></extract-modal>
    <extract-result-modal ref="modalResult"></extract-result-modal>
    <data-set-desc-modal ref="modalDescForm"></data-set-desc-modal>
    <data-set-quality-modal ref="modalQualityForm"></data-set-quality-modal> 
    <fill-na-modal ref="modalFillNaForm"></fill-na-modal>  
  </a-card>
</template>

<script>
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import '@/assets/less/TableExpand.less'
import ExtractModal from './ExtractModal'
import ExtractResultModal from './ExtractResultModal'
import DataSetDescModal from './DataSetDescModal' 
import DataSetQualityModal from './DataSetQualityModal' 
import FillNaModal from './dataSet/FillNaModal' 
export default {
  name: 'DataSetBuild',
  mixins: [JeecgListMixin],
  components: {
    ExtractModal,
    ExtractResultModal,
    DataSetDescModal,
    DataSetQualityModal,
    FillNaModal
  },
  data() {
    return {
      description: '数据集生成',
      // 表头
      columns: [
        {
          title: '#',
          dataIndex: '',
          key: 'rowIndex',
          width: 60,
          align: 'center',
          customRender: function (t, r, index) {
            return parseInt(index) + 1
          },
        },
        {
          title: '数据集名称',
          align: 'center',
          dataIndex: 'name',
          width: 200,
        },
        {
          title: '数据集编码',
          align: 'center',
          dataIndex: 'code',
          width: 200,
        },
        {
          title: '数据量',
          align: 'center',
          dataIndex: 'dataSize',
          width: 200,
        },
         {
          title: '槽号',
          align: 'center',
          dataIndex: 'slotNo',
          width: 200,
        },
        {
          title: '创建日期',
          align: 'center',
          dataIndex: 'createTime',
          width: 200,
        },
        {
          title: '备注',
          align: 'center',
          dataIndex: 'remark',
        },
        {
          title: '操作',
          dataIndex: 'action',
          align: 'center',
          fixed: 'right',
          width: 147,
          scopedSlots: { customRender: 'action' },
        },
      ],
      url: {
        list: '/dataSet/dataSet/list',
        delete: '/dataSet/dataSet/delete',
        deleteBatch: '/userFormula/userFormula/deleteBatch',
        exportXlsUrl: '/userFormula/userFormula/exportXls',
        importExcelUrl: 'userFormula/userFormula/importExcel',
      },
      dictOptions: {},
      superFieldList: [],
    }
  },
  created() {
    this.getSuperFieldList()
  },
  computed: {},
  methods: {
    initDictConfig() {},
    getSuperFieldList() {
      let fieldList = []
      fieldList.push({ type: 'string', value: 'formulaName', text: '公式名称', dictCode: '' })
      fieldList.push({ type: 'string', value: 'formulaContent', text: '内容', dictCode: '' })
      fieldList.push({ type: 'date', value: 'modifyDate', text: '修改日期' })
      fieldList.push({ type: 'string', value: 'remark', text: '备注', dictCode: '' })
      fieldList.push({ type: 'int', value: 'seqNo', text: '序号，用于公式排序', dictCode: '' })
      fieldList.push({ type: 'string', value: 'userId', text: '创建人', dictCode: '' })
      this.superFieldList = fieldList
    },
    modalFormOk(data) { 
      this.$refs.modalResult.show(data)
    },
    handleSjgy(record){
      this.$refs.modalDescForm.show(record)
    },
    handleZlfx(record){
      this.$refs.modalQualityForm.show(record.id)
    },
    handleSjqx(record){
      this.$refs.modalFillNaForm.show(record.id)
    }
  },
}
</script>
<style scoped>
@import '~@assets/less/common.less';
</style>